export default {
    namespaced: true,
    state: {
        isLogin: false,
        user: undefined
    },
    mutations: {
        login(state, user) {
            state.isLogin = true
            state.user = user
        },
        logout(state) {
            state.isLogin = false
            state.user = {};
        }
    },
    actions: {
        login(context, user) {
            context.commit('login', user)
        },
        logout(context) {
            context.commit('logout')
        }
    }
}